home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / CustomWriterGX / OldApp.r < prev    next >
Encoding:
Text File  |  1996-03-20  |  6.3 KB  |  220 lines  |  [TEXT/MPS ]

  1. /*
  2.     FILENAME
  3.         OldApp.r
  4.  
  5.     DESCRIPTION
  6.         Contains resource descriptions for old-application compatibility.
  7.  
  8.     COPYRIGHT
  9.         Copyright © 1995 Apple Computer, Inc.
  10.         All rights reserved.
  11.     
  12.     Modification history
  13.         10/04/95 - David Hayward -    Version 1.0.4 modified code so that
  14.                                     the driver can be build under MPW,
  15.                                     Metrowerks, and Symantec.  In general,
  16.                                     all that was required to do this was 
  17.                                     to add an inline-assembly jumptable
  18.                                     and to store all globals off of the
  19.                                     message manager instance context.
  20.                                     Also made a few changes so that the
  21.                                     driver can be rebuilt to support any
  22.                                     resolution by changing the #defines
  23.                                     kResolution and kPatStretch in
  24.                                     "CommonDefines.h"
  25.  
  26.         06/14/95 - Dave Hersey -    Version 1.0.3 to fix a bug in
  27.                                     CustomBufferingAndIO.c when creating
  28.                                     high-res PICTs, and to make the size
  29.                                     of buffers more flexible.
  30.  
  31.         05/26/95 - Dave Hersey -    Version 1.0.2 to add the new 'outp'
  32.                                     desktop printer resource in NewApp.c.
  33.  
  34.         05/03/95 - Dave Hersey -    Version 1.0.1 to fix some minor bugs in
  35.                                     CustomBufferingAndIO.c.
  36.  
  37.         01/14/95 - Dave Hersey -    Created from the shell of a hollowed-out
  38.                                     ImageWriter driver.
  39. */
  40.  
  41.  
  42. #define SystemSevenOrLater 1
  43.  
  44. #include "Types.r"
  45. #include "SysTypes.r"
  46. #include "GXPrintingResTypes.r"
  47. #include "GXPrintingResEquates.r"
  48. #include "CommonDefines.h"
  49.  
  50.  
  51. // This resource allows us to customize the old API's behavior - all drivers
  52. // should have a resource of this type
  53.  
  54. resource gxCustType (gxCustID, sysheap, purgeable)
  55. {
  56.     kResolution, kResolution,        // our best DPI
  57.     defaultUpDriver,                // we use the default up driver
  58.     { kPatStretch, kPatStretch },    // pattern stretch factor
  59.     gxOptimizedTranslation + gxRasterTargetTranslation
  60. };
  61.  
  62.  
  63. // PrGeneral resolution resource.
  64.  
  65. resource gxReslType (gxReslID, sysheap, purgeable)
  66. {
  67.     rangeType,
  68.     gxDiscreteResolution, gxDiscreteResolution,
  69.     gxDiscreteResolution, gxDiscreteResolution,
  70.     {
  71.         72, 72;
  72.         kResolution, kResolution;
  73.     }
  74. };
  75.  
  76.  
  77. // Overrides for old application messages, and where to find them in the jump table.
  78. // This resource must be kept in sync with the assembly
  79. // jump table in OldApp.c and OldApp.a
  80.  
  81. resource gxOverrideType (gxDriverCompatibilityOverrideID, sysheap, purgeable)
  82. {
  83.     {
  84.         gxConvertPrintRecordTo,            OldSegID, 4,
  85.         gxConvertPrintRecordFrom,        OldSegID, 8,
  86.         gxPrValidate,                    OldSegID, 12
  87.     };
  88. };
  89.  
  90.  
  91. // Page Setup dialog
  92.  
  93. resource 'dctb' (-8192, sysheap, purgeable) {
  94.     {    /* array ColorSpec: 0 elements */
  95.     }
  96. };
  97.  
  98. resource 'DLOG' (-8192, sysheap, purgeable) {
  99.     {30, 20, 174, 492},
  100.     dBoxProc,
  101.     invisible,
  102.     noGoAway,
  103.     0x1,
  104.     -8192,
  105.     "Stl",
  106.     noAutoCenter
  107. };
  108.  
  109. resource 'DITL' (-8192, sysheap, purgeable) {
  110.     {    /* array DITLarray: 18 elements */
  111.         /* [1] */ {8, 404, 27, 464}, Button { enabled, "OK" },
  112.         /* [2] */ {35, 404, 54, 464}, Button { enabled, "Cancel" },
  113.         /* [3] name frill */ {4, 4, 20, 384}, StaticText { disabled, DriverName },
  114.         /* [4] line frill */ {20, 4, 24, 393}, UserItem { disabled },
  115.         /* [5] */ {24, 4, 40, 60}, StaticText { disabled, "Paper:" },
  116.         /* [6] */ {24, 68, 40, 208}, RadioButton { enabled, "¿" },
  117.         /* [7] */ {24, 218, 40, 383}, RadioButton { enabled, "¿" },
  118.         /* [8] */ {39, 68, 55, 208}, RadioButton { enabled, "¿" },
  119.         /* [9] */ {39, 218, 55, 383}, RadioButton { enabled, "¿" },
  120.         /* [10] */ {54, 68, 70, 208}, RadioButton { enabled, "¿" },
  121.         /* [11] */ {54, 218, 70, 383}, RadioButton { enabled, "¿" },
  122.         /* [12] */ {74, 4, 90, 88}, StaticText { disabled, "Orientation" },
  123.         /* [13] portrait icon */ {93, 5, 125, 37}, UserItem { enabled },
  124.         /* [14] landscape icon */ {93, 45, 125, 77}, UserItem { enabled },
  125.         /* [15] version frill */ {4, 348, 19, 384}, UserItem { enabled },
  126.         /* [16] default frill */ {4, 400, 24, 460}, UserItem { enabled },
  127.     }
  128. };
  129.  
  130. // Page Setup dialog dctl
  131. resource 'dctl' (-8192, sysheap, purgeable) {
  132.     16,
  133.     {
  134.         Button { 2, cancel },
  135.         Frill { 4, line },
  136.         PaperSizes { 0, 0, { 6, 7, 8, 9, 10, 11 } },
  137.         Orientation { 13, 14, 0, 0 },
  138.         Frill { 15, version },
  139.         Frill { 16, default },
  140.     }
  141. };
  142.  
  143. // Version string for old dialogs
  144. resource 'STR ' (-8190, sysheap, purgeable) { "1.0.4" };
  145.  
  146.  
  147. // Print Dialog
  148.  
  149. resource 'dctb' (-8191, sysheap, purgeable) {
  150.     {    /* array ColorSpec: 0 elements */
  151.     }
  152. };
  153.  
  154. resource 'DLOG' (-8191, sysheap, purgeable) {
  155.     {50, 20, 154, 492},
  156.     dBoxProc,
  157.     invisible,
  158.     noGoAway,
  159.     0x1,
  160.     -8191,
  161.     "Job",
  162.     noAutoCenter
  163. };
  164.  
  165. resource 'DITL' (-8191, sysheap, purgeable) {
  166.     {    /* array DITLarray: 19 elements */
  167.         /* [1] */ {8, 404, 27, 464}, Button { enabled, "Print" },
  168.         /* [2] */ {35, 404, 54, 464}, Button { enabled, "Cancel" },
  169.         /* [3] name frill */ {4, 4, 20, 384}, StaticText { disabled, DriverName },
  170.         /* [4] line frill */ {20, 5, 24, 393}, UserItem { disabled },
  171.         /* [5] */ {44, 4, 60, 88}, StaticText { disabled, "Page Range:" },
  172.         /* [6] */ {44, 100, 60, 188}, RadioButton { enabled, "All" },
  173.         /* [7] */ {44, 200, 60, 260}, RadioButton { enabled, "From:" },
  174.         /* [8] */ {44, 264, 60, 296}, EditText { disabled, "" },
  175.         /* [9] */ {44, 304, 60, 332}, StaticText { disabled, "To:" },
  176.         /* [10] */ {44, 332, 60, 364}, EditText { disabled, "" },
  177.         /* [11] */ {64, 4, 80, 88}, StaticText { disabled, "Copies:" },
  178.         /* [12] */ {64, 100, 80, 132}, EditText { disabled, "1" },
  179.         /* [13] version frill */ {4, 348, 19, 384}, UserItem { enabled },
  180.         /* [14] default frill */ {4, 400, 24, 460}, UserItem { enabled }
  181.     }
  182. };
  183.  
  184. // Print dialog dctl
  185. resource 'dctl' (-8191, sysheap, purgeable) {
  186.     14,
  187.     {
  188.         Button { 2, cancel },
  189.         Frill { 4, line },
  190.         PageRange { 6, 7, 8, 10},
  191.         Copies { 12 },
  192.         Frill { 13, version },
  193.         Frill { 14, default },
  194.     }
  195. };
  196.  
  197.  
  198. // Our driver's default print record for old apps.  This is
  199. // loaded by the default implementation of gxPrintDefault.
  200.  
  201. data 'PREC' (0, sysheap, purgeable) {
  202.     $"000C"                    // print record version
  203.     $"0000"                    // iDev
  204.     $"0048 0048"            // horizontal and vertical resolution
  205.     $"0000 0000 02F0 0280"    // rPage
  206.     $"FFDC FFEC 02F4 0294"    // rPaper
  207.     $"8804"                    // wDev = 0x88, 0x04 == Portrait
  208.      
  209.     // Misc. values follow.  We use the same as the IW.
  210.     $"0528 03FC 0001"
  211.     $"0000"                    // iDev
  212.     $"0048 0048"            // horizontal and vertical resolution
  213.  
  214.      // More misc. settings follow.  We use the same as the IW.
  215.     $"0000 0000 02F0 0280 0050 0020 0280 0C80 0018 0001 0101 0000"
  216.     $"0001 270F 0001 0101 0000 0000 0000 0000 0000 0000 0000 0000"
  217.     $"0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000"
  218.     $"0000 0000 0000 0000 0000"
  219. };
  220.